//
//  USMovieCell.m
//  HWSGW
//
//  Created by avachen on 15/11/2.
//  Copyright © 2015年 luxuanrui. All rights reserved.
//

#import "USMovieCell.h"
#import "Movie.h"
#import "UIImageView+WebCache.h"
#import "StarView.h"

@implementation USMovieCell

- (void)awakeFromNib {
    //去掉选中风格
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}
- (void)layoutSubviews{
    [super layoutSubviews];
    _titleLabel.text =  self.movie.title;
    _yearLabel.text = [NSString stringWithFormat:@"年份：%@", self.movie.year];
    _ratingLabel.text = [NSString stringWithFormat:@"%.1f", [self.movie.average floatValue]];
    
    //加载图片，使用第三方框架
    NSString *medium = [self.movie.images objectForKey:@"medium"];
    NSURL *url = [NSURL URLWithString:medium];
    [_imgView sd_setImageWithURL:url];
    
    
    _starView.rating = [self.movie.average floatValue];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
